#include <stdlib.h>
#include <stdio.h>

static int c = 0;

int fun(int a, int b){
	int sum = 0;

	while (a--)
	{
		sum += b--;
		c = sum;
	}

	while (b--){
		sum += b;

		if (a)
			sum = 0;
	}

	return sum;
}

int main(int argc, char* argv[])
{
	int a, b;

	a = 3;
	b = 3;
	c = fun(a, b);

	if (a < b)
		putchar(c);

	return 0;
}
